home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / Source / tarsrc Folder / tape.h < prev    next >
Text File  |  1993-11-27  |  2KB  |  102 lines

  1. /*
  2.  * Generic SCSI tape driver
  3.  */
  4.  
  5. #define OP_READY    0x00    /* test unit ready */
  6. #define OP_REWIND    0x01    /* rewind */
  7. #define OP_ERAALT    0x02    /* erase (alternate) */
  8. #define OP_SENSE    0x03    /* request sense */
  9. #define OP_RBL        0x05    /* read block limits */
  10. #define OP_RAS        0x06    /* request auxiliary sense */
  11. #define OP_READ        0x08    /* read */
  12. #define OP_WRITE    0x0a    /* write */
  13. #define OP_WFM        0x10    /* write file marks */
  14. #define OP_SPACE    0x11    /* space */
  15. #define OP_INQUIRY    0x12    /* inquiry */
  16. #define OP_RBD        0x14    /* read buffered data */
  17. #define OP_MODESELECT    0x15    /* mode select */
  18. #define OP_RESERVE    0x16    /* reserve unit */
  19. #define OP_RELEASE    0x17    /* release unit */
  20. #define OP_ERASE    0x19    /* erase */
  21. #define OP_MODESENSE    0x1a    /* mode sense */
  22. #define OP_PREWIND    0x1b    /* prewind */
  23. #define OP_LOCK        0x1e    /* lock cassette (light LED) */
  24.  
  25. #define S_NOSENSE    0x0
  26. #define S_NOTREADY    0x2
  27. #define S_MEDERROR    0x3
  28. #define S_HDERROR    0x4
  29. #define S_ILLREQ    0x5
  30. #define S_UNITATTN    0x6
  31. #define S_DATAPROTECT    0x7
  32. #define S_NODATA    0x8
  33. #define S_ABORTED    0xb
  34. #define S_VOLOVER    0xd
  35.  
  36. #define IMMEDIATE    1
  37. #define WAIT        0
  38.  
  39. #define FIXED        1
  40. #define VARIABLE    0
  41.  
  42. #define BLOCKS        0
  43. #define FILEMARKS    1
  44. #define SEQFM        2    /* sequential file marks */
  45. #define EOD        3    /* physical end of data */
  46.  
  47. typedef struct {
  48.     Byte    valid:1;
  49.     Byte    class:3;
  50.     Byte    code:4;
  51.     Byte    segment;
  52.     Byte    fmk:1;
  53.     Byte    eom:1;
  54.     Byte    ili:1;
  55.     Byte    rsvd0:1;
  56.     Byte    key:4;
  57.     Byte    info[4];
  58.     Byte    asl;
  59.     Byte    csi[4];
  60.     Byte    asc;
  61.     Byte    ascq;
  62.     Byte    fruc;
  63.     Byte    sks[3];
  64. } Sense;
  65.  
  66. typedef struct {
  67.     Byte    type;
  68.     Byte    rmb:1;
  69.     Byte    qualifier:7;
  70.     Byte    isov:2;
  71.     Byte    ecmav:3;
  72.     Byte    ansiv:3;
  73.     Byte    rsvd1;
  74.     Byte    al;
  75.     Byte    rsvd2[3];
  76.     Byte    vendor[8];
  77.     Byte    product[16];
  78.     Byte    revision[4];
  79. } Inquiry;
  80.  
  81. typedef struct {
  82.     Byte    mdl;
  83.     Byte    mediumType;
  84.     Byte    wp:1;
  85.     Byte    bufMode:3;
  86.     Byte    speed:4;
  87.     Byte    bdl;
  88.     Byte    densityCode;
  89.     Byte    numBlocks[3];
  90.     Byte    :8;
  91.     Byte    blockLen[3];
  92. } ModeData;
  93.  
  94. typedef struct {
  95.     Byte    :8;
  96.     Byte    maxBL[3];
  97.     Byte    minBL[2];
  98. } RBLData;
  99.  
  100. #define BYTES4_INT(x)    (((x)[0] << 24) | ((x)[1] << 16) | ((x)[2] << 8) | (x)[3])
  101. #define BYTES3_INT(x)    (((x)[0] << 16) | ((x)[1] << 8) | (x)[2])
  102. #define BYTES2_INT(x)    (((x)[0] << 8) | (x)[1])